<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/spring.tld"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld"%>
<%@ taglib prefix="fn" uri="/WEB-INF/tlds/fn.tld"%>
<%@ taglib prefix="fmt" uri="/WEB-INF/tlds/fmt.tld"%>
<c:set var="BasePath" value="${pageContext.request.contextPath}"></c:set>
<c:set var="Plugins" value="${pageContext.request.contextPath}/res/plugins"></c:set>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>采购单退货详情</title>
<link href="${Plugins}/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="${Plugins}/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<script src="${Plugins}/datepicker/WdatePicker.js" type="text/javascript"></script>
<script src="${Plugins}/jquery/jquery-1.3.2.min.js"	type="text/javascript"></script>
<script src="${Plugins}/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script src="${BasePath}/res/js/common/utils.js" type="text/javascript"></script>
<script src="${BasePath}/res/js/ligerCommon.js" type="text/javascript"></script>
<style type="text/css">
#searchbar{
	margin-bottom: 10px;
}
.navbar {
		height: 20px;
		border-bottom: #E6E6E6 solid 1px;
		line-height: 20px;
	}
.l-button-search{
	width: 50px;
	margin-left: 10px;
	padding-bottom: 2px;
	display: inline;
}
</style>
</head>
<body style="padding:6px; overflow:hidden;">
<div id="">
	<div class="navbar"><span>您当前的位置：采购退货管理 &gt;采购单退货详情  </span></div>
	<br/>
	<table width="100%" cellpadding="0" cellspacing="0" class="l-table-edit" style="TABLE-LAYOUT: fixed" >
	    <tr height="30">
	        <td align="right" class="l-table-edit-td">采购退货单号：</td>
	        <td align="left" class="l-table-edit-td">${po.puNo }</td>
	        <td align="right" class="l-table-edit-td">采购单号：</td>
	        <td align="left" class="l-table-edit-td">${po.poNo }</td>
	        <td align="right" class="l-table-edit-td">创建人：</td>
	        <td align="left" class="l-table-edit-td">${po.creater}</td>
	        <td align="right" class="l-table-edit-td">创建时间：</td>
	        <td align="left" class="l-table-edit-td">${po.createTime }</td>
	       
	    </tr>
	    <tr height="30"></tr>
	    <tr>
	    
	     <td align="right" class="l-table-edit-td">采购单状态：</td>
	        <td align="left" class="l-table-edit-td">
	        	<c:choose>
	        		<c:when test="${po.status == 0 }">
	        			待审核
	        		</c:when>
	        		<c:when test="${po.status == 1 }">
	        			已审核
	        		</c:when>
	        		<c:when test="${po.status == 2 }">
	        			采购中
	        		</c:when>
	        		<c:when test="${po.status == 3 }">
	        			入库中
	        		</c:when>
	        		<c:when test="${po.status == 4 }">
	        			采购完成
	        		</c:when>
	        		<c:when test="${po.status == 5 }">
	        			入库中
	        		</c:when>
	        		<c:when test="${po.status == 6 }">
	        			采购换货完成
	        		</c:when>
	        		<c:otherwise>
	        			&nbsp;
	        		</c:otherwise>
	        	</c:choose>
	        
	        </td>
	        
	       <%--  <td align="right" class="l-table-edit-td">货品编号：</td>
	        <td align="left" class="l-table-edit-td">${po.prodNo }</td> --%>
	        
			 <c:if test="${po.lastAuditPerson != null}">
				<td align="right" class="l-table-edit-td">最近审核人：</td>
	        	<td align="left" class="l-table-edit-td">${po.lastAuditPerson}</td>
	        </c:if> 
	        <%-- <td align="right" class="l-table-edit-td">审核流程：</td>
	        <td align="left" class="l-table-edit-td">
	        	<c:choose>
	        		<c:when test="${po.curAuditPoint == 1 }">
	        			待采购主管处理
	        		</c:when>
	        		<c:when test="${po.curAuditPoint == 2 }">
	        			待采购总监及运营主管处理
	        		</c:when>
	        		<c:when test="${po.curAuditPoint == 3 }">
	        			待财务负责人处理
	        		</c:when>
	        		<c:when test="${po.curAuditPoint == 4 }">
	        			待总经理处理
	        		</c:when>
	        		<c:when test="${po.curAuditPoint == 99 }">
	        			已结束流程
	        		</c:when>
	        		<c:otherwise>
	        			&nbsp;
	        		</c:otherwise>
	        	</c:choose>	
			</td> --%>
	        
	    </tr>
	    
	</table>
	<br/>
</div>
<div id="maingrid6" style="margin:0; padding:0"></div>
  <div style="display:none;">
  <!-- g data total ttt -->
</div>
 <br/>
   &nbsp;&nbsp;<input  type="button" id="exit" style="margin-left: 1500px;" name="exit" value="返回" class="l-button l-button-test" >
  <br/>

<script type="text/javascript">
    var grid6 = null;
    var showList = "${showList}";
    $(function () {
      if(showList.toLowerCase() != "auhis") {
    	  var columns = [
    	            { display: '货品编码', name: 'prodNo', align: 'left', width: '10%', render: function (rowdata, rowindex, value) {
    	            	return '<span title="' + value + '">' + value + '</span>';
    	            } },
    	            { display: '商品名称', name: 'commodityName', width: '12%', render: function (rowdata, rowindex, value) {
    	            	value = StringUtils.html_encode(value);
    	            	return '<span title="' + value + '">' + value + '</span>';
    	            } },
    	            { display: '箱包装规格', name: 'specification', width: '8%' },
    	            { display: '供应商名称', name: 'supName', width: '10%', render: function(rowdata, rowindex, value) {
    	            	return StringUtils.html_encode(value);
    	            } },
    	            { display: '仓库名称', name: 'purWhName', width: '8%', render: function(rowdata, rowindex, value) {
    	            	return StringUtils.html_encode(value);
    	            } },
    	            { display: '数量', name: 'yieldAmountNumner'},
    	            { display: '成本价', name: 'purUnitPrice'},
    	            { display: '总价',name:"totalPrice"	},
    	            { display: '退换货原因',name:"returnDesc"	},
    	            { display: '描述',name:"description"	}
    	            ];
        grid6 = $("#maingrid6").ligerGrid({
            columns: columns, 
            pageSize: 30,
            width: '100%',
            height: '94%',
            dataType: 'server', 
            dataAction: 'server',
            pagesizeParmName: 'pageSize',
            enabledEdit:true,
            parms: [
                    {name: "puNo", value:'${po.puNo }' }
                    /* {name: "prodNo", value:'${po.prodNo }'} */
            	],
            url: "ajaxToPoProductList.do"
        });
      } else {
        grid6 = $("#maingrid6").ligerGrid({
            columns: [
            { display: '审核人', name: 'auditPersonName', align: 'left', width: '10%', render: function (rowdata, rowindex, value) {
            	value = StringUtils.html_encode(value);
            	return '<span title="' + value + '">' + value + '</span>';
            } },
            { display: '审核时间', name: 'auditTime', width: '12%', render: function (rowdata, rowindex, value) {
            	return '<span title="' + value + '">' + value + '</span>';
            } },
            { display: '审核结果', name: 'auditResult', width: '8%', render: function(rowdata, rowindex, value) {
            	if (value == 1) {
            		return '通过';
            	} else if (value == 2) {
            		return '不通过';
            	} else {
            		return '';
            	}
            } },
            { display: '备注', name: 'remark', render: function(rowdata, rowindex, value) {
            	return StringUtils.html_encode(value);
            } }
            ], 
            pageSize: 30,
            width: '100%',
            height: '100%',
            dataType: 'server', 
            dataAction: 'server',
            pagesizeParmName: 'pageSize',
           
            parms: [
                    {name: "poNo", value:'${po.poNo }' }
            	],
            url: "ajaxToPoAuditHistoryList.do"
        });
    	  
      }
        
    });
    
    /**
     * 采购单商品单价及数量修改
     * @param rowindex
     */
     function modifyPriceAndQuantity(poNo, prodNo) {
     	var w = $.ligerDialog.open({ title: "采购商品单价及数量修改", url: 'toPoProdPriceAndQuantityModify.do?poNo=' + poNo + '&prodNo=' + prodNo, height: 400, width: 600, isResize: false, isDrag: false });
     	w.show();
     }
    /*显示采购单货品列表*/
    function showPoProds(){
    	window.location.href="showPoDetail.do?poNo=${po.poNo}&showList=prods";
    }

 // 取消
    $("#exit").click(function() {
    	close_liger_tab();
    });	
   
</script>
</body>
</html>